<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>添加编辑</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="css/space.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(function() {
		$.ajax({
			type : "post",//发送方式       
			url : "space/getAllPerByChiefId.action",// 路径   
			data : "",
			success : function(data) {
				var obj = eval("(" + data + ")");
				var html = "";
				for ( var i = 0; i < obj.length; i++) {
					html += "<option value='"+obj[i].periodicalId+"'>"
							+ obj[i].name + "</option>";
				}
				$("#ajaxJsonSelectId>option").remove();
				$("#ajaxJsonSelectId").append(html);
			}
		});
	});
</script>
</head>

<body>
	<div class="all">
		<div class="bodyge-left">
			<div class="bodyge-left-a1"><span class="font-b">添加编辑</span></div>
			<div style="margin-left:50px; font-size:13px;">
				<form action="space/getUserByUserNameEditor.action" method="post">
					按会员用户名搜索：
					<input type="text" name="user.userName" />
					<input type="submit" class="inputStyle" value="搜索" />
					<!-- 隐藏域为了判断是 哪个页面请求的信息-->
					<input type="hidden" name="value" value="addEditor" />
				</form>
			</div>
			<form action="space/addEditor.action" method="post">
				<table class="ma-tab" cellspacing="0px" cellpadding="0px">
					<tr class="ma-tab-tr_a">
						<td>用户名</td>
						<td>姓名</td>
						<td>公司</td>
						<td>电话</td>
						<td>选择期刊</td>
						<td>操作</td>
					</tr>
					<tr height="5px"></tr>
					<c:if test="${user != null }">
						<tr>
							<td width="80px">${user.userName }</td>
							<td width="80px">${userExt.realName }</td>
							<td width="140px">${userExt.company }</td>
							<td width="80px">${userExt.tel }</td>
							<td align="center" width="90px">
								<input type="hidden" name="editor.userId" value="${user.userId }" /> 
								<input type="hidden" name="editor.result" value="1" /> 
								<select id="ajaxJsonSelectId" name="editor.periodicalId" style="width: 90px;">
									<option value="0">请选择期刊</option>
								</select>
							</td>
							<td align="center" width="80px">
							<c:if test="${user.roleId == 2}">
								<input type="submit" value="设为编辑" />
							</c:if>

							<c:if test="${user.roleId != 2}">
								<input type="submit" disabled="disabled" value="已有其他职务" />
							</c:if>
							</td>
						</tr>
					</c:if>
				</table>
			</form>
		</div>
	</div>
</body>
</html>
